package com.gbx.ximalayating.application;

import android.app.Application;

import com.gbx.ximalayating.callback.HttpService;
import com.gbx.ximalayating.service.BroadcastService;
import com.gbx.ximalayating.service.ClassifyService;
import com.gbx.ximalayating.service.RecommendService;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**ice;

 * Created by Administrator on 2016/12/2.
 */

public class BaseApplication extends Application {

    private ClassifyService classifyService;
    private ClassifyService foot;
    private BroadcastService broadcastService;
    private HttpService httpService;
    private RecommendService RecomOne;
    private RecommendService RecomTwo;
    private RecommendService RecomThree;
    @Override
    public void onCreate() {
        super.onCreate();
        foot = new Retrofit.Builder()
                .baseUrl("http://adse.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(ClassifyService.class);

        classifyService = new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(ClassifyService.class);
        broadcastService = new Retrofit.Builder()
                .baseUrl("http://live.ximalaya.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(BroadcastService.class);
        httpService=new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(HttpService.class);
        RecomOne=new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendService.class);
        RecomTwo=new Retrofit.Builder()
                .baseUrl("http://mobile.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendService.class);
        RecomThree=new Retrofit.Builder()
                .baseUrl("http://adse.ximalaya.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build()
                .create(RecommendService.class);
    }

    public ClassifyService getFootView(){
        return foot;
    }
    public ClassifyService getClassifyService(){
        return classifyService;
    }
    public BroadcastService getBroadcastService(){
        return broadcastService;
    }
    public HttpService getHttpService(){
        return httpService;
    }
    public RecommendService getRecomOne(){
        return RecomOne;
    }
    public RecommendService getRecomTwo(){
        return RecomTwo;
    }
    public RecommendService getRecomThree(){
        return RecomThree;
    }
}
